#ifndef LEMC_ENTRY_H
#define LEMC_ENTRY_H

#include <rapidxml.hpp>
#include <rapidxml_utils.hpp>

#include "../util/logmanager.h"
#include "../graphics/sprite.h"
#include "../system/global.h"

class Entry
{
private:
	int m_player_number;
	int m_x;
	int m_y;
	int m_size_x;
	int m_size_y;

	int m_time;
	float m_current_time;
	bool m_spawn_lems;
	bool m_new_lem;

	int m_lems_spawned;
	int m_lems_to_spawn;

	Sprite* m_sprite;

public:
	Entry(int player_number, std::string type_name, int x, int y, int animation_time, int lems_to_spawn);
	~Entry();

	void Open();

	void Update(float timing_factor);
	void Draw();

	int player_number() { return m_player_number; }
	bool new_lem() { return m_new_lem; }
	int lems_spawned() { return m_lems_spawned; }
	void set_new_lem(bool new_lem) { m_new_lem = new_lem; }
	void set_spawn_lems(bool spawn_lems) { m_spawn_lems = spawn_lems; }

	float spawn_position_x() { return m_x + 0.5 * m_size_x - STANDARD_LEM_WIDTH * 0.5; }
	float spawn_position_y() { return m_y + 0.5 * m_size_y; }
};

#endif;